package com.wwj.admin.player.controller;

import com.github.pagehelper.Page;
import com.wwj.core.wawa.entity.PlayerAddress;
import com.wwj.core.wawa.service.IPlayerAddressService;
import com.wwj.framework.controller.BaseController;
import com.wwj.framework.utils.Page2EasyUiData;
import com.wwj.framework.utils.ReturnData;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Auser on 2017/11/3.
 */

@Controller
@RequestMapping("/player/address")
public class PlayerAddressController extends BaseController{

    @Resource
    private IPlayerAddressService playerAddressService;

    @RequestMapping(value = "/list_by_play_id/{playId}")
    @ResponseBody
    public ReturnData listByPlayId(@PathVariable("playId") int playId)throws Exception{
        List<PlayerAddress> list = playerAddressService.selectPlayerAddressesByPlayerId(playId);
        return new ReturnData().success(Page2EasyUiData.format(list));
    }
}
